<template>
    <h1>树形控件</h1>
    <div class="main">
        <TreeItem :data="data.list"></TreeItem>
    </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, reactive, ref } from "vue";
import axios from "axios";
import TreeItem from "../components/treeitem.vue";
export default defineComponent({
    components: {
        TreeItem,
    },
    setup() {
        let data = reactive({
            list: [[], []],
        });

        onMounted(() => {
            axios.get("https://cfan.cc/tc/?mod=vue&act=getdata&uid=10294&token=9167dd4299790d143a1249014adb108d").then((res) => {
                // console.log(res);
                data.list = res.data.msg;
                console.log(data.list);
            });
        });
        return {
            data,
        };
    },
});
</script>
<style scoped>
.main {
    width: 500px;
    height: 666px;
}
</style>
